package com.yungu.swift.order.service;

import com.yungu.swift.assets.driver.model.dto.DriverDto;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.order.model.dto.OrderDetailDto;
import com.yungu.swift.order.model.dto.OrderDto;
import com.yungu.swift.order.model.dto.OrderFareDto;
import com.yungu.swift.order.model.param.AdminAssOrCloseParam;
import com.yungu.swift.order.model.param.CrosstownAssignOrderParam;
import com.yungu.swift.order.model.param.MergeAssignParam;
import com.yungu.swift.order.model.vo.JsonOrderDetailVo;

/**
 * 派单接口
 *
 * @author Zerrion
 * @date 2017/12/26
 */
public interface OrderAssignService {

    /**
     * 司机锁定列表缓存 key
     */
    String ASSIGN_DRIVER_LOCK = "assignDriverLock";

    /**
     * 通过派单配置表执行的实时派单方法 [专快车]
     *
     * @param orderUuid 订单主键
     * @return AjaxList
     * @author Zerrion
     * @date 2017/12/26
     */
    ResponseData<Boolean> assignRealTime(String orderUuid);

    /**
     * 逻辑
     *
     * @param orderUuid  参数
     * @param driverDto  参数
     * @param uploadText 参数
     * @return AjaxList
     */
    ResponseData<JsonOrderDetailVo> updGrab(String orderUuid, DriverDto driverDto, String uploadText);

    /**
     * 后台改派（行程开始前）
     *
     * @param assOrCloseParam 改派参数
     * @return AjaxList
     */
    ResponseData<Boolean> reassign(AdminAssOrCloseParam assOrCloseParam);

    /**
     * 改派出租车订单
     *
     * @param assOrCloseParam 参数
     * @return AjaxList
     */
    ResponseData<Boolean> reassignTaxiOrder(AdminAssOrCloseParam assOrCloseParam);

    /**
     * 出租车叫单逻辑
     *
     * @param orderDto       参数
     * @param orderDetailDto 参数
     * @param orderFareDto   参数
     * @return AjaxList
     */
    ResponseData<String> addTaxiOrder(OrderDto orderDto, OrderDetailDto orderDetailDto, OrderFareDto orderFareDto);

    /**
     * 跨城拼车：派单
     *
     * @param crosstownAssignOrderParam
     * @return
     */
    ResponseData<JsonOrderDetailVo> doAssignJoinOrder(CrosstownAssignOrderParam crosstownAssignOrderParam);

    /**
     * 跨城自动派单
     *
     * @param crosstownAssignOrderParam
     * @return
     */
    ResponseData<JsonOrderDetailVo> doAssignCrosstownOrderAuto(CrosstownAssignOrderParam crosstownAssignOrderParam);

    /**
     * 跨城司机抢单
     */
    ResponseData<JsonOrderDetailVo> grabCrosstownOrder(CrosstownAssignOrderParam crosstownAssignOrderParam);

    /**
     * 合并派单
     */
    ResponseData<Boolean> doMergeAssign(MergeAssignParam margeAssignParam);

    /**
     * 跨城拼车：扫码下单派单
     *
     * @param crosstownAssignOrderParam
     * @return
     */
    ResponseData<Boolean> doScanOrderAssign(CrosstownAssignOrderParam crosstownAssignOrderParam);
}
